package top.infopub.job.fia.service.impl;

import java.math.BigDecimal;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import top.infopub.generic.GenericDao;
import top.infopub.generic.GenericServiceImpl;
import top.infopub.job.fia.dao.IncomeBillDao;
import top.infopub.job.fia.service.IncomeBillService;
import top.infopub.model.fia.IncomeBill;

@Service
public class IncomeBillServiceImpl extends GenericServiceImpl<IncomeBill, String> implements
		IncomeBillService {

	@Autowired
	private IncomeBillDao incomeBillDao;
	
	@Override
	public GenericDao<IncomeBill, String> getDao() {
		return incomeBillDao;
	}

    @Override
    public BigDecimal selectProQaOfCashIn(Map<String, Object> where) {
        return incomeBillDao.selectProQaOfCashIn(where);
    }
    
    @Override
    public BigDecimal selectProSingleOfCashIn(Map<String, Object> where) {
        BigDecimal rs = incomeBillDao.selectProSingleOfCashIn(where);
        if (rs == null) {
            return BigDecimal.ZERO;
        }
        return rs;
    }

    @Override
    public BigDecimal selectAreaQaOfCashIn(Map<String, Object> where) {
        return incomeBillDao.selectAreaQaOfCashIn(where);
    }

    @Override
    public BigDecimal selectAllProQaOfCashIn(Map<String, Object> where) {
        return incomeBillDao.selectAllProQaOfCashIn(where);
    }

    @Override
    public BigDecimal selectIncomeOfCashIn(Map<String, Object> where) {
        BigDecimal rs = incomeBillDao.selectIncomeOfCashIn(where);
        if(null == rs){
            rs = BigDecimal.ZERO;
        }
        return rs;
    }

    @Override
    public BigDecimal selectIncomeAmountOfCashIn(Map<String, Object> where) {
        BigDecimal rs = incomeBillDao.selectIncomeAmountOfCashIn(where);
        if(null == rs){
            rs = BigDecimal.ZERO;
        }
        return rs;
    }

    @Override
    public BigDecimal selectIncomeOfCashInNine(Map<String, Object> where) {
        BigDecimal rs = incomeBillDao.selectIncomeOfCashInNine(where);
        if(null == rs){
            rs = BigDecimal.ZERO;
        }
        return rs;
    }

    @Override
    public BigDecimal selectIncomeOfCashInTen(Map<String, Object> where) {
        BigDecimal rs = incomeBillDao.selectIncomeOfCashInTen(where);
        if(null == rs){
            rs = BigDecimal.ZERO;
        }
        return rs;
    }
}